﻿using System.Linq;
using Odin.Contracts.Data;
using Odin.Contracts.Services;
using Odin.Execution.Utils;

namespace Odin.Execution.Services
{
	public class WindowService : IWindowService
	{
		public IWindow[]	GetWindows()
		{
			var windows = new Windows(true, false).ToArray();
			return windows;
		}

		public IWindow[] GetWindowsStartingWith(string name)
		{
			var query = from w in GetWindows()
			            where w.Title.StartsWith(name)
			            select w;
			return query.ToArray();
		}
	}
}